<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<%@ include file="/commons/dateTime.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>反馈登记</title>
<script type="text/javascript">
   function save(){
    var isTrue=$("addForm").fireEvent("onSubmit");
      if(isTrue){
         document.getElementById("addForm").submit();
       }
   }

   function display(id,type){
       if(type=='show'){
       document.getElementById(id).style.display="";
       Validation.changeElmValidate(id,"required validate-dateTime-yyyy-mm-dd-HH:mm great-than-startTime");
       }
       if(type=='hide'){
       document.getElementById(id).style.display="none";
        Validation.changeElmValidate(id,"validate-date");
       document.getElementById("endTime").value="";

       }
   }

     function selectPerson(){
  var url = "${ctx}/common_employeeQuery.do?method=initSelectPsrsonMain&frameName=addBackRecord&callBack=selectPersonCallBack&multiple=false";
		top.windowOpen(url, "selectPerson", "", 530, 700,true,"selectPerson");

  }

  function selectPersonCallBack(info){
  var onePerson= new Array();

  onePerson=info.split(";");

    for (i=0;i<onePerson.length ;i++ )
    {
     var oneAttribute= new Array();
     oneAttribute=onePerson[i].split(",");

        var userId=oneAttribute[0];
        var employeeName=oneAttribute[1];
        var deptId=oneAttribute[2];
        var dept=oneAttribute[3];


document.getElementById("deptName").value=dept;

document.getElementById("executant").value=employeeName;
document.getElementById("deptId").value=deptId;

    }


  }

</script>

</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><span class="window_head_intext"><img src="${ctx}/images/ico_Advance.gif" align="absmiddle" /> 反馈登记</span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td colspan="2" class="content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="aux_outtable_color">
		<div>
		<table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
<form id="addForm" name="addForm" method="post" action="${ctx}/customerService_feedbackRecordAction.do?method=addFeedbackRecord" class="required-validate">
<input type="hidden" name="deptId" value="">
          <tr>
            <td valign="top" class="aux_intable_td1">派工单号：</td>
            <td colspan="3" valign="top" class="aux_intable_td2">
            ${feedbackRecordVO.dispatchNo}
            <input type="hidden" name="dispatchFormId" value="${dispatchFormId}">
            </td>
          </tr>
          <tr>
            <td valign="top" class="aux_intable_td1">是否完工：</td>
            <td colspan="3" class="aux_intable_require">
              <input name="hasComplete" type="radio" value="1" onClick="display('tr06','show');" checked />
是&nbsp;　&nbsp;　&nbsp; &nbsp;
<input name="hasComplete" type="radio" value="0" onClick="display('tr06','hide');"/>
否</td>
          </tr>
          <tr id="tr05">
             <td valign="top" class="aux_intable_td1">开工时间：</td>
             <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
               <tr>
                 <td><input name="startTime" type="text" validateUrl="${ctx}/customerService_feedbackRecordAction.do?method=checkStartTimeAndDispatchTime" relativeId="dispatchFormId"
                 class="validate-dateTime-yyyy-mm-dd-HH:mm validate-ajax" value="<fmt:formatDate value='${feedbackRecordVO.startTime}' pattern='yyyy-MM-dd HH:mm'/>" size="16" afterInsert="tempStartTime"/></td>
                 <td width="4">&nbsp;</td>
                 <td><img id="startTimeImgBtn" src="${ctx}/images/ico_clock.gif" width="20" height="20" /><span id="tempStartTime"></span></td>
               </tr>
             </table></td>
           </tr>
           <tr id="tr06" style="display:">
             <td valign="top" class="aux_intable_td1">完工时间：</td>
             <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
               <tr>
                 <td><input name="endTime" type="text" class="required validate-dateTime-yyyy-mm-dd-HH:mm great-than-startTime" validateMessageGreatThan="完工时间不能比开工时间早" value="<fmt:formatDate value='${feedbackRecordVO.endTime}' pattern='yyyy-MM-dd HH:mm'/>" size="16"  afterInsert="tempEndTime"/></td>
                 <td width="4">&nbsp;</td>
                 <td><img id="endTimeImgBtn" src="${ctx}/images/ico_clock.gif" width="20" height="20" /><span id="tempEndTime"></span></td>
               </tr>
             </table></td>
           </tr>

		 <tbody colspan="4" width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" id="tr1" style="display:show">
		  <tr>
            <td valign="top" class="aux_intable_td1">客户满意度评价：</td>
            <td colspan="3" class="aux_intable_td2"><input name="satisfiedDegree" type="radio" value="非常满意"/>
            非常满意&nbsp;
            <input name="satisfiedDegree" type="radio" value="满意"  checked/>
             满意&nbsp;
            <input name="satisfiedDegree" type="radio" value="一般"  />
            一般
            &nbsp;
            <input name="satisfiedDegree" type="radio" value="不满意"  />
            不满意
            &nbsp;
            <input name="satisfiedDegree" type="radio" value="非常不满意"  />
           非常不满意 </td>
          </tr>
		  </tbody>
		  <tr>
		    <td valign="top" class="aux_intable_td1">反馈内容：</td>
		    <td colspan="3" class="aux_intable_require_more">
		      <textarea name="content" cols="36" rows="3" class="required max-length-100">${feedbackRecordVO.content}</textarea>		    </td>
		    </tr>
            <td class="aux_intable_td1">客户姓名：</td>
            <td class="aux_intable_td2">
              <input name="client" type="text" class="validate-char" value="${feedbackRecordVO.client}" size="16" maxLength="36"/>            </td>
          </tr>
			<tr  id="tr03">
            <td class="aux_intable_td1">执行人：</td>
            <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input name="executant" type="text" class="inputtext" readOnly value="" size="16" /></td>
                <td width="4">&nbsp;</td>
                <td><a href="#"  onClick="selectPerson();"onFocus="this.blur()"><img src="${ctx}/images/ico_cz.gif" width="16" height="16" border="0" /></a></td>
              </tr>
            </table></td>
          </tr>
		   <tr id="tr04">
            <td class="aux_intable_td1">责任部门：</td>
            <td class="aux_intable_td2">
            <input name="deptName" type="text" class="inputtext" value="${feedbackRecordVO.deptName}" size="16" readOnly/>
              </td>
            </tr>
           <tr id="tr07">
             <td valign="top" class="aux_intable_td1">记录人：</td>
             <td class="aux_intable_td2">${feedbackRecordVO.recorder}
              <input type="hidden" name="recorder" value="${feedbackRecordVO.recorder}">
              </td>
           </tr>
           <tr id="tr08">
            <td valign="top" class="aux_intable_td1">记录时间：</td>
            <td class="aux_intable_td2"><fmt:formatDate value="${feedbackRecordVO.recordTime}" pattern="yyyy-MM-dd HH:mm"/>
            <input type="hidden" name="recordTime" value="<fmt:formatDate value='${feedbackRecordVO.recordTime}' pattern='yyyy-MM-dd HH:mm'/>">
            </td>
           </tr>
           </form>
        </table>
		</div></td>
      </tr>
    </table></td>
  </tr>
  <tr>

    <td class="window_footer"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="buttonOffLeft" id="btn1_61"></td>
        <td class="buttonOffMiddle" id="btn1_62" onClick="save();"  onMouseOver="btn_change_over(6)" onMouseOut="btn_change_out(6)" onBlur="btn_change(6)"><img src="${ctx}/images/ico_ok.gif" alt="" border="0" align="absbottom" />&nbsp; 保 存 </td>
        <td class="buttonOffRight" id="btn1_63"></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onBlur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table>
    <p>&nbsp;</p></td>
  </tr>
</table>
</body>
<script type="text/javascript">

        Calendar.setup(
              {
	              inputField : "startTime", // ID of the input field
	              ifFormat : "%Y-%m-%d %H:%M", // the date format
	              button : "startTimeImgBtn", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true,
			      showsTime      :    true
              }
       );

        Calendar.setup(
              {
	              inputField : "endTime", // ID of the input field
	              ifFormat : "%Y-%m-%d %H:%M", // the date format
	              button : "endTimeImgBtn", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true,
			      showsTime      :    true
              }
       );


</script>
</html>